.class public final Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;
.super Ljava/lang/Object;
.source "ImportFieldsPresenter.kt"


# annotations
.annotation system Ldalvik/annotation/SourceDebugExtension;
    value = "SMAP\nImportFieldsPresenter.kt\nKotlin\n*S Kotlin\n*F\n+ 1 ImportFieldsPresenter.kt\nlt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter\n*L\n1#1,92:1\n*E\n"
.end annotation


# instance fields
.field private final context:Landroid/content/Context;

.field private loadedFields:Ljava/util/List;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldModel;",
            ">;"
        }
    .end annotation
.end field

.field private final mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;


# direct methods
.method public constructor <init>(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;Landroid/content/Context;)V
    .locals 1

    const-string v0, "mView"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    const-string v0, "context"

    invoke-static {p2, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 9
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    iput-object p2, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->context:Landroid/content/Context;

    .line 11
    new-instance p1, Ljava/util/ArrayList;

    invoke-direct {p1}, Ljava/util/ArrayList;-><init>()V

    iput-object p1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->loadedFields:Ljava/util/List;

    return-void
.end method


# virtual methods
.method public final cancelConfirmed()V
    .locals 1

    .line 56
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->finishActivityActionCancel()V

    return-void
.end method

.method public final getConvertedFields()V
    .locals 3

    .line 22
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showImportingDialog()V

    .line 23
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->getImportFilePath()Ljava/lang/String;

    move-result-object v0

    .line 24
    new-instance v1, Llt/noframe/gpsfarmguide/import_fields/geoconvert/ImportFileTask;

    iget-object v2, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->context:Landroid/content/Context;

    invoke-direct {v1, v2, v0}, Llt/noframe/gpsfarmguide/import_fields/geoconvert/ImportFileTask;-><init>(Landroid/content/Context;Ljava/lang/String;)V

    .line 25
    invoke-static {}, Lio/reactivex/schedulers/Schedulers;->io()Lio/reactivex/Scheduler;

    move-result-object v0

    invoke-virtual {v1, v0}, Lio/reactivex/Single;->subscribeOn(Lio/reactivex/Scheduler;)Lio/reactivex/Single;

    move-result-object v0

    .line 26
    invoke-static {}, Lio/reactivex/android/schedulers/AndroidSchedulers;->mainThread()Lio/reactivex/Scheduler;

    move-result-object v1

    invoke-virtual {v0, v1}, Lio/reactivex/Single;->observeOn(Lio/reactivex/Scheduler;)Lio/reactivex/Single;

    move-result-object v0

    .line 27
    new-instance v1, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$getConvertedFields$tsk$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$getConvertedFields$tsk$1;-><init>(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;)V

    .line 32
    new-instance v2, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$getConvertedFields$tsk$2;

    invoke-direct {v2, p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$getConvertedFields$tsk$2;-><init>(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;)V

    .line 27
    invoke-virtual {v0, v1, v2}, Lio/reactivex/Single;->subscribe(Lio/reactivex/functions/Consumer;Lio/reactivex/functions/Consumer;)Lio/reactivex/disposables/Disposable;

    return-void
.end method

.method public final getLoadedFields()Ljava/util/List;
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "()",
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldModel;",
            ">;"
        }
    .end annotation

    .line 11
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->loadedFields:Ljava/util/List;

    return-object v0
.end method

.method public final getMView()Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;
    .locals 1

    .line 9
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    return-object v0
.end method

.method public final onBackClicked()V
    .locals 1

    .line 52
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showCancelConfirmationDialog()V

    return-void
.end method

.method public final onCancelClicked()V
    .locals 1

    .line 48
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showCancelConfirmationDialog()V

    return-void
.end method

.method public final onDestroy()V
    .locals 0

    return-void
.end method

.method public final onRestoredInstanceState(Landroid/os/Bundle;)V
    .locals 0

    return-void
.end method

.method public final onRetryClicked()V
    .locals 0

    .line 89
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->getConvertedFields()V

    return-void
.end method

.method public final onSaveClicked()V
    .locals 3

    .line 74
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showSavingDialog()V

    .line 75
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->getSelectedFields()Ljava/util/List;

    move-result-object v0

    .line 76
    new-instance v1, Llt/noframe/gpsfarmguide/import_fields/imports/FieldsDBImporter;

    invoke-direct {v1, v0}, Llt/noframe/gpsfarmguide/import_fields/imports/FieldsDBImporter;-><init>(Ljava/util/List;)V

    .line 77
    invoke-static {}, Lio/reactivex/schedulers/Schedulers;->newThread()Lio/reactivex/Scheduler;

    move-result-object v0

    invoke-virtual {v1, v0}, Lio/reactivex/Single;->subscribeOn(Lio/reactivex/Scheduler;)Lio/reactivex/Single;

    move-result-object v0

    .line 78
    invoke-static {}, Lio/reactivex/android/schedulers/AndroidSchedulers;->mainThread()Lio/reactivex/Scheduler;

    move-result-object v1

    invoke-virtual {v0, v1}, Lio/reactivex/Single;->observeOn(Lio/reactivex/Scheduler;)Lio/reactivex/Single;

    move-result-object v0

    .line 79
    new-instance v1, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$onSaveClicked$sdis$1;

    invoke-direct {v1, p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$onSaveClicked$sdis$1;-><init>(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;)V

    .line 82
    new-instance v2, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$onSaveClicked$sdis$2;

    invoke-direct {v2, p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter$onSaveClicked$sdis$2;-><init>(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;)V

    .line 79
    invoke-virtual {v0, v1, v2}, Lio/reactivex/Single;->subscribe(Lio/reactivex/functions/Consumer;Lio/reactivex/functions/Consumer;)Lio/reactivex/disposables/Disposable;

    return-void
.end method

.method public final onSavedInstanceState(Landroid/os/Bundle;)V
    .locals 0

    return-void
.end method

.method public final onSelectAllClicked()V
    .locals 3

    .line 60
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->switchSelectAll()V

    .line 61
    iget-object v0, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->getSelectedFields()Ljava/util/List;

    move-result-object v0

    .line 62
    iget-object v1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Ljava/util/Collection;->isEmpty()Z

    move-result v2

    xor-int/lit8 v2, v2, 0x1

    invoke-interface {v1, v2}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->setEnabledImportButton(Z)V

    .line 63
    iget-object v1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {v0}, Ljava/util/List;->size()I

    move-result v0

    invoke-interface {v1, v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showSelectedFieldsCount(I)V

    return-void
.end method

.method public final onSelectionChanged(Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldModel;Z)V
    .locals 1

    const-string p2, "item"

    invoke-static {p1, p2}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 67
    iget-object p1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {p1}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->getSelectedFields()Ljava/util/List;

    move-result-object p1

    .line 68
    iget-object p2, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {p1}, Ljava/util/Collection;->isEmpty()Z

    move-result v0

    xor-int/lit8 v0, v0, 0x1

    invoke-interface {p2, v0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->setEnabledImportButton(Z)V

    .line 69
    iget-object p2, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->mView:Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;

    invoke-interface {p1}, Ljava/util/List;->size()I

    move-result p1

    invoke-interface {p2, p1}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsViewInterface;->showSelectedFieldsCount(I)V

    return-void
.end method

.method public final onViewPrepared()V
    .locals 0

    .line 14
    invoke-virtual {p0}, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->getConvertedFields()V

    return-void
.end method

.method public final setLoadedFields(Ljava/util/List;)V
    .locals 1
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "(",
            "Ljava/util/List<",
            "Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldModel;",
            ">;)V"
        }
    .end annotation

    const-string v0, "<set-?>"

    invoke-static {p1, v0}, Lkotlin/jvm/internal/Intrinsics;->checkParameterIsNotNull(Ljava/lang/Object;Ljava/lang/String;)V

    .line 11
    iput-object p1, p0, Llt/noframe/gpsfarmguide/import_fields/imports/ImportFieldsPresenter;->loadedFields:Ljava/util/List;

    return-void
.end method
